package com.face.pay.util;


import java.lang.reflect.Field;

/**
 * @Auther: zkj
 * @Date: 2019/9/11 10:45
 * @Description:
 */
public class SimpleBeanUtil {

    /**
     * 一个类所有字段都不能为空
     * @return
     */
    public static Boolean allNotEmpity(Object object){

        Boolean validate = true;

        try {
            if(object!=null){

                Class cls = object.getClass();

                Field[] fields =  cls.getDeclaredFields();

                for(Field f :fields){
                    f.setAccessible(true);
                    String fileName =    f.getName();

                    f.setAccessible(true);
                    Object value = f.get(object);

                    if(value==null  ||"".equals(value)){

                        validate =  false;

                        break;
                    }
                }

            }
        }catch (Exception e){

        }

        return  validate;
    }
}
